﻿using GCC.Container.LogProviders;
using GCC.Container.MQ;

public class aa
{
    public static void Main()
    {
        _ = GCCLoggerProvider.GetInstance(new LogOptions()).CreateLogger<aa>();
        var host = "amqp://baseserver.type-t.tech:5672";
        string password = "admin", userName = "admin";
        string vh = "/";
        string queueName = "testQueue";

        Console.WriteLine(Manager.SendMessageTo(host, userName, password, vh, queueName, Guid.NewGuid().ToString("N")));


        Manager.GotOneMessageFrom(host, userName, password, vh, queueName, (data) =>
        {

            return false;
        });

        var token = Manager.GotMessageFrom(host, userName, password, vh, queueName, (data) =>
        {
            _ = Manager.SendMessageTo(host, userName, password, vh, queueName, Guid.NewGuid().ToString("N"));
            return true;
        });

        Console.WriteLine($"token: {token}");


        _ = Console.ReadLine();


    }

}